function hPfrintf = getPrintf(LogFile)

if nargin < 1 || isempty(LogFile)
    hPfrintf = @(varargin) fprintf(sprintf(varargin{:}));
else
    mycaffe.logFile(LogFile, '================================================', 'a', true);
    hPfrintf = @(varargin) mycaffe.logFile(LogFile, sprintf(varargin{:}), 'a');
end
